package com.oauth2.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

import org.hibernate.annotations.GenericGenerator;

/**
 * GatewayUser entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "gateway_user", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = "key"))
public class GatewayUser implements java.io.Serializable {

	// Fields

	private String id;
	private String realname;
	private String usercode;
	private String phone;
	private String username;
	private String password;
	private String state;
	private String lastLoginTime;
	private String key;
	private String salt;
	private String clientId;
	private String resourceIds;
	private String clientSecret;
	private String scope;
	private String authorizedGrantTypes;
	private String webServerRedirectUri;
	private String authorities;
	private Long accessTokenValidity;
	private Long refreshTokenValidity;
	private String additionalInformation;
	private Date createTime;
	private String trusted;
	private Boolean autoapprove;
	private String whiteList;
	private String isOpenWhiteList;
	// Constructors

	/** default constructor */
	public GatewayUser() {
	}

	/** full constructor */
	public GatewayUser(String realname, String usercode, String phone,
			String username, String password, String state,
			String lastLoginTime, String key, String salt, String clientId,
			String resourceIds, String clientSecret, String scope,
			String authorizedGrantTypes, String webServerRedirectUri,
			String authorities, Long accessTokenValidity,
			Long refreshTokenValidity, String additionalInformation,
			 Date createTime, String trusted, Boolean autoapprove) {
		this.realname = realname;
		this.usercode = usercode;
		this.phone = phone;
		this.username = username;
		this.password = password;
		this.state = state;
		this.lastLoginTime = lastLoginTime;
		this.key = key;
		this.salt = salt;
		this.clientId = clientId;
		this.resourceIds = resourceIds;
		this.clientSecret = clientSecret;
		this.scope = scope;
		this.authorizedGrantTypes = authorizedGrantTypes;
		this.webServerRedirectUri = webServerRedirectUri;
		this.authorities = authorities;
		this.accessTokenValidity = accessTokenValidity;
		this.refreshTokenValidity = refreshTokenValidity;
		this.additionalInformation = additionalInformation;
		this.createTime = createTime;
		this.trusted = trusted;
		this.autoapprove = autoapprove;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "realname")
	public String getRealname() {
		return this.realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	@Column(name = "usercode")
	public String getUsercode() {
		return this.usercode;
	}

	public void setUsercode(String usercode) {
		this.usercode = usercode;
	}

	@Column(name = "phone", length = 50)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "username")
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "password", length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "state")
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "last_login_time")
	public String getLastLoginTime() {
		return this.lastLoginTime;
	}

	public void setLastLoginTime(String lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	@Column(name = "key", unique = true, length = 50)
	public String getKey() {
		return this.key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	@Column(name = "salt", length = 32)
	public String getSalt() {
		return this.salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	@Column(name = "client_id", length = 32)
	public String getClientId() {
		return this.clientId;
	}

	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

	@Column(name = "resource_ids")
	public String getResourceIds() {
		return this.resourceIds;
	}

	public void setResourceIds(String resourceIds) {
		this.resourceIds = resourceIds;
	}

	@Column(name = "client_secret")
	public String getClientSecret() {
		return this.clientSecret;
	}

	public void setClientSecret(String clientSecret) {
		this.clientSecret = clientSecret;
	}

	@Column(name = "scope")
	public String getScope() {
		return this.scope;
	}

	public void setScope(String scope) {
		this.scope = scope;
	}

	@Column(name = "authorized_grant_types")
	public String getAuthorizedGrantTypes() {
		return this.authorizedGrantTypes;
	}

	public void setAuthorizedGrantTypes(String authorizedGrantTypes) {
		this.authorizedGrantTypes = authorizedGrantTypes;
	}

	@Column(name = "web_server_redirect_uri")
	public String getWebServerRedirectUri() {
		return this.webServerRedirectUri;
	}

	public void setWebServerRedirectUri(String webServerRedirectUri) {
		this.webServerRedirectUri = webServerRedirectUri;
	}

	@Column(name = "authorities")
	public String getAuthorities() {
		return this.authorities;
	}

	public void setAuthorities(String authorities) {
		this.authorities = authorities;
	}

	@Column(name = "access_token_validity")
	public Long getAccessTokenValidity() {
		return this.accessTokenValidity;
	}

	public void setAccessTokenValidity(Long accessTokenValidity) {
		this.accessTokenValidity = accessTokenValidity;
	}

	@Column(name = "refresh_token_validity")
	public Long getRefreshTokenValidity() {
		return this.refreshTokenValidity;
	}

	public void setRefreshTokenValidity(Long refreshTokenValidity) {
		this.refreshTokenValidity = refreshTokenValidity;
	}

	@Column(name = "additional_information")
	public String getAdditionalInformation() {
		return this.additionalInformation;
	}

	public void setAdditionalInformation(String additionalInformation) {
		this.additionalInformation = additionalInformation;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", length = 13)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "trusted", length = 1)
	public String getTrusted() {
		return this.trusted;
	}

	public void setTrusted(String trusted) {
		this.trusted = trusted;
	}

	@Column(name = "autoapprove")
	public Boolean getAutoapprove() {
		return this.autoapprove;
	}

	public void setAutoapprove(Boolean autoapprove) {
		this.autoapprove = autoapprove;
	}
	@Column(name = "white_list")
	public String getWhiteList() {
		return whiteList;
	}

	public void setWhiteList(String whiteList) {
		this.whiteList = whiteList;
	}
	@Column(name = "is_open_white_list")
	public String getIsOpenWhiteList() {
		return isOpenWhiteList;
	}

	public void setIsOpenWhiteList(String isOpenWhiteList) {
		this.isOpenWhiteList = isOpenWhiteList;
	}

}